{include file="pub/header" /}
	<div class="body"> 
		<div class="nav">
			添加用户组
		</div>
		<div class="tap">
			<span class="active">添加用户组</span>
		</div>
		<div class="from">
			<form action="" class="active" method="post" enctype="multipart/form-data">
				<div class="p">
					<label>
						<span class="span">用户组名称</span>
						<input type="text" name="name" value="{$ad_group.name}">
					</label>
				</div>
				{foreach name="auth" item="vo" }
				    <div class="p">
						<span class="span">模块名称</span>
						<label>
							<input type="checkbox" class="auth"/>{$vo.name}
						</label>
					</div>
					
				    <div class="p check">
				    	{foreach name="vo.children" item="v" }
							<label>
								<input type="checkbox" name="{$v.cname}_{$v.aname}" value="1" {if condition="isset($ad_group['auth'][$v['cname'].'_'.$v['aname']])"}checked{/if}  />{$v.name}
							</label>
						{/foreach}

					</div>
				{/foreach}
				<div class="p">
					<label>
						<input type="submit" value="提交">
					</label>
				</div>
			</form>
			<script type="text/javascript">
				$(".auth").click(function(event) {
					if($(this).prop('checked')){
						$(this).parents(".p").next(".check").find("input[type='checkbox']").prop('checked',true);
					}else{
						$(this).parents(".p").next(".check").find("input[type='checkbox']").prop('checked',false);
					}
				});
			</script>
		</div>
	</div>
{include file="pub/footer" /}
